<template>
  <a-modal v-model:visible="visible" @ok="handleOk" @cancel="handleCancel">
    <template #title>温馨提示</template>
    <p>是否确定删除数据-[ <span class="title_style"> {{dataItem}} </span> ] ?</p>
  </a-modal>
</template>

<script lang="ts" setup>
import { ref, defineEmits } from 'vue';
const visible = ref(false);
const dataItem = ref('');
const curId = ref('');
const handleDelClick = (val:any) => {
  visible.value = true;
  dataItem.value = val.name || val.first_name +  val.last_name 
  curId.value = val.id
};
const emits = defineEmits(['submitDel'])
const handleOk = () => {
emits('submitDel', curId.value)
};
const handleCancel = () => {
  visible.value = false
};
defineExpose({ handleDelClick,visible })
</script>

<style scoped lang="less">
.title_style{
  color: #ff7d00;
}
</style>
